package com.gopay.common.domain.bank.boc.bcdl.batch.req;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;

import com.gopay.common.domain.bank.boc.bcdl.Trans;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamImplicit;

@XStreamAlias("trn-b2e0078-rq")
public class TransReqBatch extends Trans {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -1204378382253511667L;

	@XStreamAlias("transtype") 
	private String transtype;
	
	@XStreamImplicit(itemFieldName="b2e0078-rq")
	private List<Inner> inners;
	
	public TransReqBatch() {
		// TODO Auto-generated constructor stub
	}
	
	public TransReqBatch(String transtype, List<ReqBatchParam> params){
		this.transtype = transtype;
		this.inners = new ArrayList<Inner>();
		for(ReqBatchParam param :params){
			Inner inner = new Inner();
			BeanUtils.copyProperties(param,inner);
			inners.add(inner);
		}
	}
	
	@SuppressWarnings("unused")
	private static class Inner implements Serializable{

		/**
		 * 
		 */
		private static final long serialVersionUID = -4276889686224034545L;
		
		@XStreamAlias("insid") 
		private String insid;
		
		//付款人信息
		@XStreamAlias("fractn")
		private ReqBatchDrawee fractn;
		
		//货币
		@XStreamAlias("pybcur")
		private String pybcur;
		
		//批总金额
		@XStreamAlias("pybamt")
		private String pybamt;
		
		//批总笔数
		@XStreamAlias("pybnum")
		private String pybnum;
		
		//代发类型
		@XStreamAlias("crdtyp")
		private String crdtyp;
		
		//摘要
		@XStreamAlias("furinfo")
		private String furinfo;
		
		//附言
		@XStreamAlias("useinf")
		private String useinf;
		
		//付款日期
		@XStreamAlias("trfdate")
		private String trfdate;
		
		//收款人信息
		@XStreamImplicit(itemFieldName="detail")
		private List<ReqBatchPayee> detail;

		public String getInsid() {
			return insid;
		}

		public void setInsid(String insid) {
			this.insid = insid;
		}

		public String getPybcur() {
			return pybcur;
		}

		public void setPybcur(String pybcur) {
			this.pybcur = pybcur;
		}

		public String getPybamt() {
			return pybamt;
		}

		public void setPybamt(String pybamt) {
			this.pybamt = pybamt;
		}

		public String getPybnum() {
			return pybnum;
		}

		public void setPybnum(String pybnum) {
			this.pybnum = pybnum;
		}

		public String getCrdtyp() {
			return crdtyp;
		}

		public void setCrdtyp(String crdtyp) {
			this.crdtyp = crdtyp;
		}

		public String getFurinfo() {
			return furinfo;
		}

		public void setFurinfo(String furinfo) {
			this.furinfo = furinfo;
		}

		public String getUseinf() {
			return useinf;
		}

		public void setUseinf(String useinf) {
			this.useinf = useinf;
		}

		public String getTrfdate() {
			return trfdate;
		}

		public void setTrfdate(String trfdate) {
			this.trfdate = trfdate;
		}

		public ReqBatchDrawee getFractn() {
			return fractn;
		}

		public void setFractn(ReqBatchDrawee fractn) {
			this.fractn = fractn;
		}

		public List<ReqBatchPayee> getDetail() {
			return detail;
		}

		public void setDetail(List<ReqBatchPayee> detail) {
			this.detail = detail;
		}
		
	}
}
